<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>短信审核及发送</title>
    <link rel="stylesheet" href="static/themes/gray/easyui.css">
    <link rel="stylesheet" href="static/themes/iconfont/iconfont.css">
    <script src="static/js/jquery.min.js"></script>
    <script src="static/js/jquery.easyui.min.js"></script>
    <script src="static/js/easyui-lang-zh_CN.js"></script>
<!--    <script src="static/js/dayjs.min.js"></script>-->
    <script src="static/js/moment.js"></script>
    <script src="static/js/layer/layer.js"></script>
    <link rel="stylesheet" href="static/common-page.css">

</head>
<body>
<div id="app1">
    <div style="width:850px;margin:10% auto;">
        <div>
            <div class="form-control">
                发送时间：
                <div class="control-item">
                    <input id="datetime1" type="text" class="easyui-datetimebox" data-options="height:32,editable:false,width:300">
                </div>
                <div class="control-item" style="width:70px;text-align: center;">至</div>
                <div class="control-item">
                    <input id="datetime2" type="text" class="easyui-datetimebox" data-options="height:32,editable:false,width:300">
                </div>
            </div>
        </div>
        <div>
            <div class="form-control">
                报警类型：
                <div class="control-item">
                    <input id="combobox1" type="text" class="easyui-combobox" data-options="height:32,width:300">
                </div>
                用户分组：
                <div class="control-item">
                    <input id="combobox2" type="text" class="easyui-combobox" data-options="height:32,width:300">
                </div>
            </div>
        </div>
        <div>
            <div class="form-control">短信内容编辑：</div>
            <div>
                <textarea name="" id="" cols="30" rows="6" class="form-control-text-area" style="width:785px;"></textarea>
            </div>
        </div>
        <div style="padding:10px 0 0 0;">
            <div class="form-control">
                <button id="button1" type="button" class="form-control-button">
                    <i class="iconfont icon-yes1 button-icon"></i>生成短信
                </button>
                <button id="button2" type="button" class="form-control-button form-control-button--primary">
                    <i class="iconfont icon-fasong1 button-icon"></i>保存并发送短信
                </button>
            </div>
        </div>
    </div>
</div>
<script>
var pageMethods = {
    date: new Date(),
    getContent: function() {
        layer.msg('加载中', {
            icon: 16,
            shade: 0.01
        });
        $.post('url', {}, function(data) {
            layer.closeAll();
            layer.msg('操作成功');
        }, 'json')
    },
    saveAndSend: function() {
        layer.msg('加载中', {
            icon: 16,
            shade: 0.01
        });
        $.post('url', {}, function(data) {
            layer.closeAll();
            layer.msg('操作成功');
        }, 'json')
    },
    init: function() {
        // 发送时间
        $('#datetime1').datetimebox('setValue', moment().subtract(1, 'days').format('YYYY-MM-DD 00:00:00'));
        $('#datetime2').datetimebox('setValue', moment().subtract(1, 'days').format('YYYY-MM-DD 23:59:59'));
        // 报警类型
        $('#combobox1').combobox({
            url: '',
        })
        // 用户分组
        $('#combobox2').combobox({
            url: '',
        })
        // 生成短信
        $('#button1').click(function() {
            pageMethods.getContent()
        })
        // 保存并发送短信
        $('#button2').click(function() {
            pageMethods.saveAndSend()
        })
    }

}
$(function() {
    pageMethods.init()
})
</script>
</body>
</html>
